//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package Common;



import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.IOException;


public class DecryptUtil {

    private static final int[] secretKey = new int[]{1, 2, 3, 2, 2, 3, 3, 3, 1, 3, 2, 3};
    private static final String PM_VALUE = "PM_VALUE";
    private static final String UT_VALUE = "utValue";

    private DecryptUtil() {
        throw new IllegalArgumentException(" DecryptUtil can't be instantiated");
    }


    public static byte[] decodeBytesReturnBytes(byte[] bs) {
        byte[] temp = new byte[bs.length];
        int index = 0;

        for(int i = 0; i < bs.length; ++i) {
            if (bs[i] != 13) {
                temp[index] = bs[i];
                ++index;
            }
        }

        byte[] newBs = new byte[index];
        System.arraycopy(temp, 0, newBs, 0, index);
        int i = 0;

        for(int m = newBs.length; i < m; ++i) {
            int a = newBs[i] & '\uffff';
            newBs[i] = (byte)(a ^ secretKey[i % 12]);
        }

        return newBs;
    }

    public static byte[] readContent(String path) throws IOException {

        BufferedInputStream bis = new BufferedInputStream(new FileInputStream(path));
        Throwable var2 = null;

        byte[] var8;
        try {
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            Throwable var4 = null;

            try {
                byte[] b = new byte[16384];

                int n;
                while((n = bis.read(b)) != -1) {
                    out.write(b, 0, n);
                }

                byte[] ret = out.toByteArray();
                bis.close();
                out.close();
                if (ret == null) {
                    var8 = new byte[0];
                    return var8;
                }

                var8 = ret;
            } catch (Throwable var34) {
                var4 = var34;
                throw var34;
            } finally {
                if (out != null) {
                    if (var4 != null) {
                        try {
                            out.close();
                        } catch (Throwable var33) {
                            var4.addSuppressed(var33);
                        }
                    } else {
                        out.close();
                    }
                }

            }
        } catch (Throwable var36) {
            var2 = var36;
            throw var36;
        } finally {
            if (bis != null) {
                if (var2 != null) {
                    try {
                        bis.close();
                    } catch (Throwable var32) {
                        var2.addSuppressed(var32);
                    }
                } else {
                    bis.close();
                }
            }

        }

        return var8;
    }

}
